package com.tcmj.dining.service.impl;

import java.util.List;
import com.tcmj.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.tcmj.dining.mapper.TzVagetablesOrderMapper;
import com.tcmj.dining.domain.TzVagetablesOrder;
import com.tcmj.dining.service.ITzVagetablesOrderService;
import com.tcmj.common.core.text.Convert;

/**
 * 点餐Service业务层处理
 * 
 * @author tcmj
 * @date 2020-05-17
 */
@Service
public class TzVagetablesOrderServiceImpl implements ITzVagetablesOrderService 
{
    @Autowired
    private TzVagetablesOrderMapper tzVagetablesOrderMapper;

    /**
     * 查询点餐
     * 
     * @param orderId 点餐ID
     * @return 点餐
     */
    @Override
    public TzVagetablesOrder selectTzVagetablesOrderById(Long orderId)
    {
        return tzVagetablesOrderMapper.selectTzVagetablesOrderById(orderId);
    }

    /**
     * 查询点餐列表
     * 
     * @param tzVagetablesOrder 点餐
     * @return 点餐
     */
    @Override
    public List<TzVagetablesOrder> selectTzVagetablesOrderList(TzVagetablesOrder tzVagetablesOrder)
    {
        return tzVagetablesOrderMapper.selectTzVagetablesOrderList(tzVagetablesOrder);
    }

    /**
     * 新增点餐
     * 
     * @param tzVagetablesOrder 点餐
     * @return 结果
     */
    @Override
    public int insertTzVagetablesOrder(TzVagetablesOrder tzVagetablesOrder)
    {
        tzVagetablesOrder.setCreateTime(DateUtils.getNowDate());
        return tzVagetablesOrderMapper.insertTzVagetablesOrder(tzVagetablesOrder);
    }

    /**
     * 修改点餐
     * 
     * @param tzVagetablesOrder 点餐
     * @return 结果
     */
    @Override
    public int updateTzVagetablesOrder(TzVagetablesOrder tzVagetablesOrder)
    {
        return tzVagetablesOrderMapper.updateTzVagetablesOrder(tzVagetablesOrder);
    }

    /**
     * 删除点餐对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteTzVagetablesOrderByIds(String ids)
    {
        return tzVagetablesOrderMapper.deleteTzVagetablesOrderByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除点餐信息
     * 
     * @param orderId 点餐ID
     * @return 结果
     */
    @Override
    public int deleteTzVagetablesOrderById(Long orderId)
    {
        return tzVagetablesOrderMapper.deleteTzVagetablesOrderById(orderId);
    }

	@Override
	public List<TzVagetablesOrder> selectTzVagetablesByUserId(Long userId) {
		// TODO Auto-generated method stub
		return tzVagetablesOrderMapper.selectTzVagetablesByUserId(userId);
	}

	@Override
	public int deleteTzVagetablesOrderByUserId(Long userId) {
		// TODO Auto-generated method stub
		return tzVagetablesOrderMapper.deleteTzVagetablesOrderByUserId(userId);
	}
}
